/*
 * daemon.h
 *
 *  Created on: 17/feb/2011
 *      Author: ivano
 */

#ifndef DAEMON_H_
#define DAEMON_H_

#include "list.h"
#include "terminals.h"

typedef struct {
	char* name;
	terminal_t* terminal;
	void (*module_transaction)(char* cmd, int outputStream);
	void* handler;
} module_t;

typedef struct {
	char* name;
	char* value;
} variable_t;

typedef struct {
	int id;
	char* file;
	int running;
	int exit_status;
	char* current_status;
	list* process_ids;
} job_t;

int prepare_daemon(terminal_t* launcher_daemon_terminal);
int daemon_task();

module_t* module_new(char* name, terminal_t* terminal, void* handler);

#endif /* DAEMON_H_ */
